<include file="public@storage"/>
<link rel="stylesheet" href="__STATIC__/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css"/>
<style>
    input[type="date"]::-webkit-inner-spin-button {
        display: none;
    }
</style>
</head>
<body>

<div class="container body-content" style=" margin-top:20px; width: 100%">
    <div class="panel panel-info" style="margin-bottom: 0.5rem">
        <div class="panel-heading"><span id="storageName">{$storageInfo[0]['name']}</span>入库明细</div>
        <input type="hidden" id="storageUuid" value="{$storageInfo[0]['uuid']}">
        <div class="panel-body">
            <div class="row">
                <div class="col-sm-12">
                    <div id="toolbar" class="btn-group">
                        <select id="selectStorage" class="btn btn-info" style="margin-left: 5px; width: 10rem"
                                onchange="changeStorage()">
                            <option value="">请选择仓库</option>
                            <volist id="uuid" name="storageInfo" id="value">
                                <option value="{$value['uuid']}">{$value['name']}</option>
                            </volist>
                        </select>
                        <!-- 按钮触发模态框 -->
                    </div>
                    <table id="table"></table>

                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script src="__STATIC__/storage/js/common/selectStorage.js"></script>
<script src="__STATIC__/js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
<script src="__STATIC__/js/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
<script>
    var storageUuid = $("#storageUuid").val();
    $(function () {
        if ($("#storageUuid").val() === '') {
            $("#selectStorage").show();
        } else {
            $("#selectStorage").hide();
        }
        init();
    });

    function init() {
        var url = "{:url('feed/getFeedOutflow')}?storageUuid=" + storageUuid;
        var columns = [
            {
                title: '序号',
                width: 50,
                align: "center",
                valign: 'middle',
                formatter: function (value, row, index) {
                    return index + 1;
                }
            },
            {
                title: '物料号',
                field: 'sub_materiel_id',
                align: "center",
                valign: 'middle',
                filter: {
                    type: 'input'
                }
            },
            {
                title: '条码',
                field: 'reel_id',
                align: "center",
                valign: 'middle',
                filter: {
                    type: 'input'
                }
            },
            {
                title: '工单号',
                field: 'feed_id',
                align: "center",
                valign: 'middle',
                filter: {
                    type: 'input'
                }
            },
            {
                title: '机器号',
                field: 'machine_id',
                align: "center",
                valign: 'middle',
                filter: {
                    type: 'input'
                }
            },
            {
                title: '站位号',
                field: 'seat_code',
                align: "center",
                valign: 'middle',
                filter: {
                    type: 'input'
                }
            },
            {
                title: '出库数量',
                field: 'count',
                align: "center",
                valign: 'middle',
                filter: {
                    type: 'input'
                }
            },
            {
                title: '仓库',
                field: 'name',
                align: "center",
                valign: 'middle',
                filter: {
                    type: 'input'
                }
            },
            {
                title: '仓储员',
                field: 'user_login',
                align: "center",
                valign: 'middle',
                filter: {
                    type: 'input'
                }
            },
            {
                title: '时间',
                field: 'time',
                align: "center",
                valign: 'middle',
                filter: {
                    type: 'input'
                }
            },
            {
                title: '备注',
                field: 'remark',
                align: "center",
                valign: 'middle',
                filter: {
                    type: 'input'
                }
            }
        ];
        initTable(url, columns, 'server',false,false);
        setColumn();
    }

    function setColumn() {
        if (storageUuid === '') {
            $('#table').bootstrapTable('showColumn', 'name');
        } else {
            $('#table').bootstrapTable('hideColumn', 'name');
        }
    }


    function closeDialog() {
        $("#advancedTable input").val("");
        $('#keyword').selectpicker('val', ['noneSelectedText']);
        $("#keyword").selectpicker('refresh');
        $("#advancedTable").hide();
    }



</script>
</html>